<template>
  <div class="InspectionReportGenerate">
    <div class="filter">
      <el-form ref="form" label-width="90px">
        <el-form-item label="巡检类型:">
          <el-checkbox-group
            v-model="filterForm.inspectionType"
            @change="handleInspectionTypeChange"
          >
            <div class="checkbox-item" v-for="item in inspectionTypeList" :key="item.id">
              <el-checkbox
                :key="item.id"
                :label="item.id"
                name="type"
                :indeterminate="inspectionTypeIndeterminate(item.id)"
              >{{item.name}}</el-checkbox>
              <el-button
                type="text"
                size="mini"
                @click="inspectionTypeMoreClick(item.id)"
                v-if="item.children && item.children.length"
              >更多</el-button>
            </div>
          </el-checkbox-group>
        </el-form-item>
        <el-form-item label v-if="specialInspectionTypeList && inspectionTypeMore_a">
          <el-checkbox-group
            v-model="filterForm.specialInspectionType_a"
            @change="handleSpecialInspectionTypeChange_a"
          >
            <div class="checkbox-item" v-for="item in specialInspectionTypeList" :key="item.id">
              <el-checkbox
                :key="item.id"
                :label="item.id"
                name="type"
                :indeterminate="specialInspectionTypeIndeterminate(item.id)"
              >{{item.name}}</el-checkbox>
              <el-button
                type="text"
                size="mini"
                @click="specialInspectionTypeMoreClick(item.id)"
                v-if="item.children && item.children.length"
              >更多</el-button>
            </div>
          </el-checkbox-group>
        </el-form-item>
        <el-form-item label v-if="specialInspectionTypeList && inspectionTypeMore_b">
          <el-checkbox-group
            v-model="filterForm.specialInspectionType_b"
            @change="handleSpecialInspectionTypeChange_b"
          >
            <div class="checkbox-item" v-for="item in specialInspectionTypeList" :key="item.id">
              <el-checkbox
                :key="item.id"
                :label="item.id"
                name="type"
                :indeterminate="specialInspectionTypeIndeterminate(item.id)"
              >{{item.name}}</el-checkbox>
              <el-button
                type="text"
                size="mini"
                @click="specialInspectionTypeMoreClick(item.id)"
                v-if="item.children && item.children.length"
              >更多</el-button>
            </div>
          </el-checkbox-group>
        </el-form-item>
        <el-form-item
          label="特巡模式:"
          v-if="specialInspectionModeList　&& specialInspectionTypeMore && inspectionTypeMore_b"
        >
          <el-checkbox-group
            v-model="filterForm.specialInspectionMode"
            @change="handleSpecialInspectionModeChange"
          >
            <div class="checkbox-item" v-for="item in specialInspectionModeList" :key="item.id">
              <el-checkbox :key="item.id" :label="item.id" name="type">{{item.name}}</el-checkbox>
              <el-button
                type="text"
                size="mini"
                @click="specialInspectionModeMoreClick(item.id)"
                v-if="item.children && item.children.length"
              >更多</el-button>
            </div>
          </el-checkbox-group>
        </el-form-item>
        <div class="operation">
          <el-form-item label="开始时间:">
            <el-date-picker
              v-model="taskHistorysParm.startTime"
              type="date"
              placeholder="选择日期时间"
              value-format="yyyy-MM-dd"
              :picker-options="startPickerOptions"
            ></el-date-picker>
          </el-form-item>
          <el-form-item label="结束时间:">
            <el-date-picker
              v-model="taskHistorysParm.endTime"
              type="date"
              placeholder="选择日期时间"
              value-format="yyyy-MM-dd"
              :picker-options="endPickerOptions"
            ></el-date-picker>
          </el-form-item>
          <el-button class="but-query" type="text" size="medium" @click="getTaskHistorysList()">
            <i class="query-icon"></i>查询
          </el-button>
          <el-button class="but-reset" type="text" size="medium" @click="reset_data()">
            <i class="reset-icon"></i>重置
          </el-button>
          <el-button class="but-export" type="text" size="medium" @click="exportExcel">
            <i class="export-icon"></i>导出报告
          </el-button>
        </div>
      </el-form>
    </div>
    <div class="content">
      <div class="content-head">巡检报告生成</div>
      <div class="content-list">
        <el-table
          ref="generateTable"
          :data="tableData"
          border
          stripe
          size="mini"
          class="el-table-redefine"
          style="width: 100%;"
          height="100%"
          @row-click="onRowClick"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="index" label="序号" align="center" width="50"></el-table-column>
          <el-table-column type="selection" :selectable="isSelectable" align="center" width="50"></el-table-column>
          <el-table-column prop="task.name" label="任务名称"></el-table-column>
          <el-table-column label="任务状态" width="160">
            <template slot-scope="scope">
              <span
                :style="'color:' + matchArrayContentWithKeyStr( 'color', scope.row.taskStatus, remarks)"
              >{{scope.row ? matchArrayContentStr(scope.row.taskStatus, taskStatus) : "未知"}}</span>
            </template>
          </el-table-column>
          <el-table-column label="审核状态" width="160">
            <template slot-scope="scope">
              <span>{{scope.row.checkStatus === 1 ? "已审核" : "未审核"}}</span>
            </template>
          </el-table-column>
          <el-table-column prop="createTime" label="开始时间"></el-table-column>
          <el-table-column prop="taskEndTime" label="结束时间"></el-table-column>
          <el-table-column prop="pointTotalNum" label="巡检点位总数" width="160"></el-table-column>
          <el-table-column prop="normalPointNum" label="正常点位数" width="160"></el-table-column>
          <el-table-column prop="alarmPointNum" label="告警点位数" width="160"></el-table-column>
          <el-table-column prop="abnormalPointNum" label="识别异常点位数" width="160"></el-table-column>
        </el-table>
      </div>
      <div class="pagination-area">
        <el-pagination
          layout="total, sizes, prev, pager, next, jumper, slot"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :page-sizes="[20, 50, 100, 300]"
          :page-size="taskHistorysParm.size"
          :current-page="taskHistorysParm.page"
          :total="tansksTotal"
        >
          <el-button type="text" size="mini">前往</el-button>
        </el-pagination>
      </div>
    </div>
  </div>
</template>
<script>
import {
  taskHistorysList,
  inspectTypesTree,
  taskHistorysExports
} from "@/api/apiManagement";
import { formatJson } from "@/utils";
import { dateToDateStr, getDateTopMonth } from "@/utils/utilsMethod";
import { join } from "path";
import { clearTimeout } from "timers";
import {
  matchArrayContent,
  matchArrayContentWithKey,
  TaskStatus,
  TaskStatusRemarks
} from "@/utils/constant";

export default {
  data() {
    return {
      downloadUrl: process.env.DOWNLOAD_URL + "/ui/task-historys/exports",
      robot_id: null,
      inspectTypesTree: [],
      filterForm: {
        inspectionType: [],
        specialInspectionType_a: [],
        specialInspectionType_b: [],
        specialInspectionMode: [],
        deviceAreasCheckList: [],
        deviceTypeCheckList: [],
        recognitionTypeCheckList: [],
        meterTypeCheckList: [],
        deviceAppearanceTypeCheckList: []
      },
      inspectionTypeMore_a: false,
      inspectionTypeMore_b: false,
      specialInspectionTypeMore: false,
      specialInspectionModeMore: false,
      inspectionTypeId: null,
      specialInspectionTypeId: null,
      specialInspectionModeId: null,
      taskHistorysParm: {
        page: 0,
        size: 20,
        startTime: "",
        endTime: "",
        inspectTypeId: ""
      },
      tableData: [],
      multipleSelection: [],
      tansksTotal: 0,
      remarks: TaskStatusRemarks,
      taskStatus: TaskStatus,
      startPickerOptions: {
        disabledDate: time => {
          let endTime =
            this.taskHistorysParm.endTime === null
              ? ""
              : this.taskHistorysParm.endTime;
          return (
            time.getTime() > new Date(endTime).getTime() ||
            time.getTime() > Date.now() - 8.64e6
          );
        }
      },
      endPickerOptions: {
        disabledDate: time => {
          let startTime =
            this.taskHistorysParm.startTime === null
              ? ""
              : this.taskHistorysParm.startTime;
          return (
            time.getTime() <
              new Date(startTime).getTime() - 8 * 60 * 60 * 1000 ||
            time.getTime() > Date.now() - 8.64e6
          ); //如果没有后面的-8.64e6就是不可以选择今天的   减去一天的时间代表可以选择同一天
        }
      }
    };
  },
  computed: {
    inspectionTypeList: function() {
      if (this.inspectTypesTree) {
        return this.inspectTypesTree;
      }
    },
    specialInspectionTypeList: function() {
      if (this.inspectionTypeList) {
        for (var i = 0, len = this.inspectionTypeList.length; i < len; i++) {
          if (this.inspectionTypeList[i].id === this.inspectionTypeId) {
            return this.inspectionTypeList[i].children;
          }
        }
      }
    },
    specialInspectionModeList: function() {
      if (this.specialInspectionTypeList) {
        for (
          var i = 0, len = this.specialInspectionTypeList.length;
          i < len;
          i++
        ) {
          if (
            this.specialInspectionTypeList[i].id ===
            this.specialInspectionTypeId
          ) {
            return this.specialInspectionTypeList[i].children;
          }
        }
      }
    }
  },
  created() {
    this.robot_id = localStorage.getItem("ydRobot_id");
    this.taskHistorysParm.robotId = this.robot_id;
    this.taskHistorysParm.startTime = dateToDateStr(
      getDateTopMonth(new Date())
    );
    this.taskHistorysParm.endTime = dateToDateStr(new Date());
    //
    this.getInspectTypesTree();
  },
  mounted() {},
  methods: {
    downloadFile(url, callback) {
      var idObject = document.getElementById("iframeDownload");
      if (idObject != null) {
        idObject.parentNode.removeChild(idObject);
      }
      var iframe = document.createElement("iframe");
      iframe.id = "iframeDownload";
      iframe.style.display = "none";
      iframe.src = url;
      document.body.appendChild(iframe);
      if (typeof callback != "undefined") {
        if (iframe.readyState) {
          iframe.onreadystatechange = function() {
            if (
              iframe.readyState == "loaded" ||
              iframe.readyState == "complete"
            ) {
              iframe.onreadystatechange = null;
              callback(); // 加载完成回调
            }
          };
        } else {
          iframe.onload = function() {
            callback(); // 加载完成回调
          };
        }
      }
    },
    exportExcel() {
      if (this.tableData.length > 0) {
        // require.ensure([], () => {
        //   const { export_json_to_excel } = require("vendor/Export2Excel");
        //   const tHeader = [
        //     "任务名称",
        //     "任务状态",
        //     "开始时间",
        //     "结束时间",
        //     "巡检点位总数",
        //     "正常点位数",
        //     "告警点位数",
        //     "识别异常点位数"
        //   ];
        //   const filterVal = [
        //     "task.name",
        //     "taskStatus",
        //     "createTime",
        //     "taskEndTime",
        //     "pointTotalNum",
        //     "normalPointNum",
        //     "alarmPointNum",
        //     "abnormalPointNum"
        //   ];
        //   const data = formatJson(
        //     filterVal,
        //     this.formatAlartType(this.tableData)
        //   );
        //   export_json_to_excel(tHeader, data, "巡检报告表");
        // });
        //

        if (this.multipleSelection.length > 0) {
          let ids = this.multipleSelection
            .map(item => {
              return item.id;
            })
            .join(",");
          var url = this.downloadUrl + "?taskHistoryIds=" + ids;
          url = url.replace(/\|/g, "%7C");

          this.downloadFile(url, () => {
            //
          });
          // window.open(url);
          //
          // var linkElement = document.createElement("a");
          // linkElement.setAttribute("href", url);
          // linkElement.setAttribute("download", "filename");
          // linkElement.click();
          //
          // var iframe = document.createElement("iframe");
          // iframe.id = "IFrameDownload";
          // iframe.style.display = "none";
          // iframe.src = url;
          // document.body.appendChild(iframe);
        } else {
          this.$message({
            message: "请选择数据"
          });
        }
      } else {
        this.$message({
          message: "请选择数据"
        });
      }
    },
    formatAlartType(data) {
      let array = data.slice(0);
      array.forEach((item, index) => {
        item["taskStatus"] = this.getTaskStatusString(item["taskStatus"]);
      });
      return array;
    },
    getNodeData(data, id) {
      if (data && id) {
        for (var i = 0, len = data.length; i < len; i++) {
          if (data[i].id === id) {
            return data[i].children;
          }
        }
      }
      return null;
    },
    setInspectTypesId() {
      if (this.inspectionTypeList && this.inspectionTypeList.length > 0) {
        for (var i = 0, len = this.inspectionTypeList.length; i < len; i++) {
          this.filterForm.inspectionType.push(this.inspectionTypeList[i].id);
        }
      }
      let temp = this.getNodeData(this.inspectionTypeList, 3);
      if (temp && temp.length > 0) {
        for (var i = 0, len = temp.length; i < len; i++) {
          this.filterForm.specialInspectionType_a.push(temp[i].id);
        }
      }
      temp = this.getNodeData(this.inspectionTypeList, 4);
      if (temp && temp.length > 0) {
        for (var i = 0, len = temp.length; i < len; i++) {
          this.filterForm.specialInspectionType_b.push(temp[i].id);
        }
        temp = this.getNodeData(temp, 11);
        if (temp && temp.length > 0) {
          for (var i = 0, len = temp.length; i < len; i++) {
            this.filterForm.specialInspectionMode.push(temp[i].id);
          }
        }
      }
    },
    getInspectTypesId() {
      let arr_id = [];
      if (
        this.filterForm.inspectionType &&
        this.filterForm.inspectionType.length > 0
      ) {
        for (
          var i = 0, len = this.filterForm.inspectionType.length;
          i < len;
          i++
        ) {
          arr_id.push(this.filterForm.inspectionType[i]);
        }
      }
      if (this.filterForm.inspectionType.some(item => item === 3)) {
        if (
          this.filterForm.specialInspectionType_a &&
          this.filterForm.specialInspectionType_a.length > 0
        ) {
          for (
            var i = 0, len = this.filterForm.specialInspectionType_a.length;
            i < len;
            i++
          ) {
            arr_id.push(this.filterForm.specialInspectionType_a[i]);
          }
        }
      }
      if (this.filterForm.inspectionType.some(item => item === 4)) {
        if (
          this.filterForm.specialInspectionType_b &&
          this.filterForm.specialInspectionType_b.length > 0
        ) {
          for (
            var i = 0, len = this.filterForm.specialInspectionType_b.length;
            i < len;
            i++
          ) {
            arr_id.push(this.filterForm.specialInspectionType_b[i]);
          }
        }
      }
      if (this.filterForm.specialInspectionType_b.some(item => item === 11)) {
        if (
          this.filterForm.specialInspectionMode &&
          this.filterForm.specialInspectionMode.length > 0
        ) {
          for (
            var i = 0, len = this.filterForm.specialInspectionMode.length;
            i < len;
            i++
          ) {
            arr_id.push(this.filterForm.specialInspectionMode[i]);
          }
        }
      }
      return arr_id;
    },
    getTaskHistorysList() {
      this.taskHistorysParm.startTime =
        this.taskHistorysParm.startTime == null
          ? ""
          : this.taskHistorysParm.startTime;
      this.taskHistorysParm.endTime =
        this.taskHistorysParm.endTime == null
          ? ""
          : this.taskHistorysParm.endTime.length <= 10 &&
            this.taskHistorysParm.endTime.length != 0
          ? this.taskHistorysParm.endTime + " 24:00:00"
          : this.taskHistorysParm.endTime;

      let arr = this.getInspectTypesId();
      if (arr && arr.length > 0) {
        this.taskHistorysParm.inspectTypeId = arr.join(",");
      } else {
        this.taskHistorysParm.inspectTypeId = "";
      }

      var parm = {
        page: this.taskHistorysParm.page,
        size: this.taskHistorysParm.size,
        robotId: this.taskHistorysParm.robotId,
        startTime: this.taskHistorysParm.startTime,
        endTime: this.taskHistorysParm.endTime,
        inspectTypeId: this.taskHistorysParm.inspectTypeId
      };
      taskHistorysList(parm)
        .then(response => {
          if (response) {
            this.tableData = response.list;
            this.tansksTotal = response.total;
          }
        })
        .catch(() => {});
    },
    // 巡检类型树
    getInspectTypesTree() {
      inspectTypesTree()
        .then(response => {
          if (response) {
            this.inspectTypesTree = response;
            this.setInspectTypesId();
            this.getTaskHistorysList();
          }
        })
        .catch(() => {});
    },
    handleSizeChange(val) {
      this.taskHistorysParm.size = val;
      this.getTaskHistorysList();
    },
    handleCurrentChange(val) {
      this.taskHistorysParm.page = val;
      this.getTaskHistorysList();
    },
    getTaskStatusString(val) {
      let str = "未知";
      switch (parseInt(val)) {
        case 0:
          str = "已执行";
          break;
        case 1:
          str = "终止";
          break;
        case 2:
          str = "暂停";
          break;
        case 3:
          str = "正在执行";
          break;
        case 4:
          str = "未执行";
          break;
        case 5:
          str = "超期";
          break;
        // case 6:
        //   str = "任务失败";
        //   break;
        case 7:
          str = "超时";
          break;
        case 8:
          str = "暂停";
          break;
      }
      return str;
    },
    getArrIndex(arr, val) {
      if (arr) {
        for (var i = 0, len = arr.length; i < len; i++) {
          if (arr[i] === val) {
            return i;
          }
        }
      }
      return -1;
    },
    reset_data() {
      this.taskHistorysParm.page = 0;
      this.taskHistorysParm.size = 20;
      this.taskHistorysParm.startTime = dateToDateStr(
        getDateTopMonth(new Date())
      );
      this.taskHistorysParm.endTime = dateToDateStr(new Date());
      this.taskHistorysParm.inspectTypeId = "";

      this.setInspectTypesId();

      this.getTaskHistorysList();
    },
    inspectionTypeIndeterminate(id) {
      let temp = this.getNodeData(this.inspectionTypeList, id);
      if (temp && temp.length > 0) {
        if (id === 3) {
          let len = this.filterForm.specialInspectionType_a.length;
          if (len > 0 && len < temp.length) {
            return true;
          }
        }
        if (id === 4) {
          for (var i = 0, len = temp.length; i < len; i++) {
            if (temp[i].id === 11) {
              if (this.specialInspectionTypeIndeterminate(temp[i].id)) {
                return true;
              }
            }
          }
          let len = this.filterForm.specialInspectionType_b.length;
          if (len > 0 && len < temp.length) {
            return true;
          }
        }
      }
      return false;
    },
    inspectionTypeMoreClick(id) {
      if (id === 3) {
        this.inspectionTypeId = id;
        this.inspectionTypeMore_a = !this.inspectionTypeMore_a;
        this.inspectionTypeMore_b = false;
      }
      if (id === 4) {
        this.inspectionTypeId = id;
        this.inspectionTypeMore_a = false;
        this.inspectionTypeMore_b = !this.inspectionTypeMore_b;
      }
      this.specialInspectionTypeMore = false;
    },
    handleInspectionTypeChange(val) {
      if (val.some(item => item === 3)) {
        if (
          this.filterForm.specialInspectionType_a &&
          this.filterForm.specialInspectionType_a.length > 0
        ) {
          //
        } else {
          let temp = this.getNodeData(this.inspectionTypeList, 3);
          if (temp && temp.length > 0) {
            for (var i = 0, len = temp.length; i < len; i++) {
              this.filterForm.specialInspectionType_a.push(temp[i].id);
            }
          }
        }
      } else {
        this.filterForm.specialInspectionType_a = [];
      }
      //
      if (val.some(item => item === 4)) {
        if (
          this.filterForm.specialInspectionType_b &&
          this.filterForm.specialInspectionType_b.length > 0
        ) {
          //
        } else {
          let temp = this.getNodeData(this.inspectionTypeList, 4);
          if (temp && temp.length > 0) {
            for (var i = 0, len = temp.length; i < len; i++) {
              this.filterForm.specialInspectionType_b.push(temp[i].id);
            }
          }
          if (
            this.filterForm.specialInspectionType_b.some(item => item === 11)
          ) {
            if (
              this.filterForm.specialInspectionMode &&
              this.filterForm.specialInspectionMode.length > 0
            ) {
              //
            } else {
              let temp = this.getNodeData(this.inspectionTypeList, 4);
              temp = this.getNodeData(this.specialInspectionTypeList, 11);
              if (temp && temp.length > 0) {
                for (var i = 0, len = temp.length; i < len; i++) {
                  this.filterForm.specialInspectionMode.push(temp[i].id);
                }
              }
            }
          } else {
            this.filterForm.specialInspectionMode = [];
          }
        }
      } else {
        this.filterForm.specialInspectionType_b = [];
        this.filterForm.specialInspectionMode = [];
      }
    },
    specialInspectionTypeIndeterminate(id) {
      let temp = this.getNodeData(this.specialInspectionTypeList, id);
      if (temp && temp.length > 0) {
        if (id === 11) {
          let len = this.filterForm.specialInspectionMode.length;
          if (len > 0 && len < temp.length) {
            return true;
          }
        }
      }
      return false;
    },
    specialInspectionTypeMoreClick(id) {
      if (this.specialInspectionTypeId !== id) {
        this.specialInspectionTypeId = id;
        this.specialInspectionTypeMore = true;
      } else {
        this.specialInspectionTypeId = id;
        this.specialInspectionTypeMore = !this.specialInspectionTypeMore;
      }
    },
    handleSpecialInspectionTypeChange_a(val) {
      if (val.length <= 0) {
        let index = this.getArrIndex(this.filterForm.inspectionType, 3);
        if (index !== -1) {
          this.filterForm.inspectionType.splice(index, 1);
        }
      } else {
        if (this.filterForm.inspectionType.some(item => item === 3)) {
          //
        } else {
          this.filterForm.inspectionType.push(3);
        }
      }
    },
    handleSpecialInspectionTypeChange_b(val) {
      if (val.some(item => item === 11)) {
        if (
          this.filterForm.specialInspectionMode &&
          this.filterForm.specialInspectionMode.length > 0
        ) {
          //
        } else {
          let temp = this.getNodeData(this.specialInspectionTypeList, 11);
          if (temp && temp.length > 0) {
            for (var i = 0, len = temp.length; i < len; i++) {
              this.filterForm.specialInspectionMode.push(temp[i].id);
            }
          }
        }
      } else {
        this.filterForm.specialInspectionMode = [];
      }
      if (val.length <= 0) {
        if (this.filterForm.inspectionType.some(item => item === 4)) {
          let index = this.getArrIndex(this.filterForm.inspectionType, 4);
          if (index !== -1) {
            this.filterForm.inspectionType.splice(index, 1);
          }
        }
      } else {
        if (this.filterForm.inspectionType.some(item => item === 4)) {
          //
        } else {
          this.filterForm.inspectionType.push(4);
        }
      }
    },
    specialInspectionModeMoreClick(id) {
      if (this.specialInspectionModeId !== id) {
        this.specialInspectionModeId = id;
        this.specialInspectionModeMore = true;
      } else {
        this.specialInspectionModeId = id;
        this.specialInspectionModeMore = !this.specialInspectionModeMore;
      }
    },
    handleSpecialInspectionModeChange(val) {
      if (val.length <= 0) {
        let index = this.getArrIndex(
          this.filterForm.specialInspectionType_b,
          11
        );
        if (index !== -1) {
          this.filterForm.specialInspectionType_b.splice(index, 1);
        }
        if (this.filterForm.specialInspectionType_b <= 0) {
          let index = this.getArrIndex(this.filterForm.inspectionType, 4);
          if (index !== -1) {
            this.filterForm.inspectionType.splice(index, 1);
          }
        }
      } else {
        if (this.filterForm.inspectionType.some(item => item === 4)) {
          //
        } else {
          this.filterForm.inspectionType.push(4);
        }
        if (this.filterForm.specialInspectionType_b.some(item => item === 11)) {
          //
        } else {
          this.filterForm.specialInspectionType_b.push(11);
        }
      }
    },
    isSelectable(row, index) {
      if (row.checkStatus === 1) {
        return true;
      }
      return false;
    },
    // 匹配类型返回
    matchArrayContentStr(val, array) {
      return matchArrayContent(val, array);
    },
    // 匹配类型返回
    matchArrayContentWithKeyStr(key, val, array) {
      return matchArrayContentWithKey(key, val, array);
    },
    onRowClick(row, column, event) {
      if (row.checkStatus === 1) {
        this.$refs.generateTable.toggleRowSelection(row);
      }
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    }
  }
};
</script>

<style>
.InspectionReportGenerate .filter .el-form-item {
  margin-top: 0;
  margin-bottom: 3px;
}
.InspectionReportGenerate .filter .el-form-item__label {
  font-size: 13px;
  line-height: 26px;
}
.InspectionReportGenerate .filter .el-form-item__content {
  font-size: 13px;
  line-height: 26px;
}
.InspectionReportGenerate .filter .el-checkbox {
  font-size: 13px;
}
.InspectionReportGenerate .filter .el-checkbox__label {
  font-size: 13px;
}
.InspectionReportGenerate .filter .el-checkbox {
  width: 100px;
  margin-left: 10px;
}
.InspectionReportGenerate .filter .el-checkbox + .el-checkbox {
  margin-left: 10px;
}
/*  */

.InspectionReportGenerate {
  width: 100%;
  height: 100%;
  display: flex;
  flex-flow: column;
}
.InspectionReportGenerate .filter {
  position: relative;
  width: 100%;
  height: auto;
  /* height: 117px; */
  background-color: #eeeeee;
}
.InspectionReportGenerate .filter .el-form {
  height: 100%;
  overflow: hidden;
}
.InspectionReportGenerate .operation {
  width: 100%;
  height: 30px;
  background: linear-gradient(
    rgb(227, 242, 238),
    rgb(202, 231, 238)
  ); /* 标准的语法 */
  border-top: 1px solid rgb(202, 231, 238);
}

.InspectionReportGenerate .operation .el-form-item {
  margin-top: 1px;
  margin-bottom: 0;
  float: left;
}
.InspectionReportGenerate .operation .el-form-item__content {
  width: 200px;
  margin-left: 5px !important;
}
.InspectionReportGenerate .operation .el-form-item__content {
  /* width: 200px; */
  margin-left: 5px !important;
  line-height: 26px;
  float: left;
}
.InspectionReportGenerate .operation .el-date-editor.el-input {
  width: 200px;
}
.InspectionReportGenerate .operation .el-input__inner {
  height: 26px;
  line-height: 26px;
}
.InspectionReportGenerate .operation .el-input__icon {
  line-height: 26px;
}

.checkbox-item {
  width: 190px;
  display: inline-block;
}

.InspectionReportGenerate .but-query,
.InspectionReportGenerate .but-reset,
.InspectionReportGenerate .but-export {
  height: 30px;
  margin-left: 20px;
  margin-right: 10px;
  padding: 0;
  font-size: 13px;
  color: #000;
  float: left;
}
.InspectionReportGenerate .query-icon {
  width: 14px;
  height: 14px;
  margin-right: 3px;
  background-image: url(../../../static/resources/images/query.png);
  background-size: 100% 100%;
  float: left;
}
.InspectionReportGenerate .reset-icon {
  width: 14px;
  height: 14px;
  margin-right: 3px;
  background-image: url(../../../static/resources/images/reset_a.png);
  background-size: 100% 100%;
  float: left;
}
.InspectionReportGenerate .export-icon {
  width: 14px;
  height: 14px;
  margin-right: 3px;
  background-image: url(../../../static/resources/images/export.png);
  background-size: 100% 100%;
  float: left;
}

.InspectionReportGenerate .content {
  position: relative;
  width: 100%;
  flex-grow: 1;
}
.InspectionReportGenerate .content-head {
  width: 100%;
  height: 27px;
  padding: 0 5px;
  line-height: 27px;
  font-size: 13px;
  background: linear-gradient(
    rgb(227, 242, 238),
    rgb(202, 231, 238)
  ); /* 标准的语法 */
}

.InspectionReportGenerate .content-list {
  position: absolute;
  width: 100%;
  height: calc(100% - 59px);
  /* overflow: auto; */
}

.InspectionReportGenerate .el-table-redefine {
  width: 100%;
  height: 100%;
  /* display: flex;
  flex-flow: column; */
}

.InspectionReportGenerate .el-table-redefine .el-table__body-wrapper {
  /* overflow: hidden;
  overflow-y: auto;
  flex-grow: 1; */
}

.InspectionReportGenerate .pagination-area {
  position: absolute;
  width: 100%;
  height: 32px;
  bottom: 0px;
  background-color: #eeeeee;
}
</style>